package com.lovo.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.common.bean.User;
import com.lovo.common.result.GlobalHandleException;
import com.lovo.user.service.UserService;
import com.lovo.user.dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author BDK-THINKPAD
* @description 针对表【t_user】的数据库操作Service实现
* @createDate 2023-08-16 14:41:47
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(User user) {
        return userMapper.getByUsernameAndPwd(user);
    }

    @Override
    public User getByUsername(String username) {
        return userMapper.getByUsername(username);
    }

    @Override
    public void sendEmail(Integer userId) {
        User user = userMapper.selectById(userId);
        System.out.println("发送邮件：" + user.getEmail());
    }

    @Override
    public void sendPhone(Integer userId) {
        User user = userMapper.selectById(userId);
        System.out.println("发送邮件：" + user.getPhone());
    }
}




